require.config({
    paths: {
        'jquery': ['http://cdn.bootcss.com/jquery/2.2.4/jquery.min', '/js/lib/jquery.min'],
        'doT': '/js/lib/doT.min',
        'bootstrap': '/js/lib/bootstrap.min',
        'datetimepicker': '/js/lib/bootstrap-datetimepicker.min',
        'select2': '/js/lib/select2.min',
        'paginator': '/js/lib/bootstrap-paginator'
    },
    shim: {
        'bootstrap': ['jquery']
    }
});

define(['paginator'], function() {
    function initPaginator(paginator, currentPage, numberOfPages, totalPages, event) {
        var options = {
            currentPage: currentPage,
            numberOfPages: numberOfPages,
            totalPages: totalPages,
            itemTexts: function(type, page, current) {
                switch (type) {
                    case 'first':
                        return '首页';
                    case 'prev':
                        return '上一页';
                    case 'next':
                        return '下一页';
                    case 'last':
                        return '末页';
                    case 'page':
                        return page;
                }
            },
            onPageChanged: event
        };
        paginator.bootstrapPaginator(options);
    }

    function addDay(date, d2a) {
        date += 24 * 60 * 60 * 1000;
        return date;
    }
    const url = "http://pushi2016.com/packer";
    const url1 = "http://qiaqia.tunnel.qydev.com/packer";

    return {
        urlBase: url,
        app_id: '93ae550f3d6b5f010f',
        app_secret: 'dffdd1d9be8d12f5d5bce8fd7c6b7896',
        initPaginator: initPaginator,
        addDay: addDay
    };
});
